package com.roy.sms.vo;

import com.roy.sms.model.Role;

public class RoleVO {

	private int id;
	private String name;
	private String remark;
	private String opt;

	public RoleVO(Role role) {
		this.id = role.getId();
		this.name = role.getName();
		this.remark = role.getRemark();
		setOpt();
	}

	public RoleVO() {
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getOpt() {
		return opt;
	}

	public void setOpt() {
		StringBuffer sb = new StringBuffer();
		sb.append("<a href='roleUserManager.do?roleId=").append(id).append("'>角色人员</a>&nbsp;&nbsp;");
		sb.append("<a href='javascript:getRoleColumns(").append(id).append(")'>角色栏目</a>");
		opt = sb.toString();
	}

	public Role getRole() {
		Role role = new Role();
		role.setId(id);
		role.setName(name);
		role.setRemark(remark);
		return role;
	}

}
